package qgs.zisu.javaconcurrency.javaconcurrency.chapter2;

/**
 * @Author: 蔡翔
 * @Date: 2019/9/6 10:22
 * @Version 1.0
 */
public class TaxCalaculator {
    private final double salary;
    private final double bonus;
    private CalculatorStrategy calculatorStrategy;

    public TaxCalaculator(double salary,double bonous){
        this.salary = salary;
        this.bonus = bonous;
    }

    public double calcTax(){
        return calculatorStrategy.calculate(salary,bonus);
    }

    public double calculate(){
        return this.calcTax();
    }

    public double getSalary() {
        return salary;
    }

    public double getBonus() {
        return bonus;
    }


    public void setCalculatorStrategy(CalculatorStrategy calculatorStrategy){
        this.calculatorStrategy = calculatorStrategy;
    }
}
